package com.szp.lagou.dubbo.filerDemo.consumer;

import com.szp.lagou.dubbo.filerDemo.consumer.config.ConsumerConfig;
import com.szp.lagou.dubbo.filerDemo.consumer.controller.HelloController;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.context.annotation.AnnotationConfigApplicationContext;

import java.io.IOException;

//@SpringBootApplication
public class ConsumerApplication {
    public static void main(String[] args) throws IOException {
//        SpringApplication.run(ConsumerApplication.class);
        AnnotationConfigApplicationContext context = new AnnotationConfigApplicationContext(ConsumerConfig.class);
        context.start();
        HelloController controller = context.getBean(HelloController.class);
        while (true) {
//            System.in.read();
            try {
                controller.hello("world");
//                System.out.println("result :" + hello);
            } catch (Exception e) {
                e.printStackTrace();
            }
        }
    }
}
